import request from '@/config/axios'
import type { Dayjs } from 'dayjs';

/** 库房操作记录表（记录库房相关操作，支撑审计追溯）信息 */
export interface WarehouseOperationLog {
  }

/** 库房操作记录与库房信息联查结果 */
export interface WarehouseOperationLogWithWarehouseRespVO {
  id: number;
  warehouseId: number;
  warehouseName: string;
  type: number;
  capacity: number;
  usedCount: number;
  operationType: number;
  creator: string;
  createTime: string;
}

// 库房操作记录表（记录库房相关操作，支撑审计追溯） API
export const WarehouseOperationLogApi = {
  // 查询库房操作记录表（记录库房相关操作，支撑审计追溯）分页
  getWarehouseOperationLogPage: async (params: any) => {
    return await request.get({ url: `/warehouseoperationlog/warehouse-operation-log/page`, params })
  },
  
  // 查询库房操作记录与库房信息联查分页
  getWarehouseOperationLogWithWarehousePage: async (params: any) => {
    return await request.get({ url: `/warehouseoperationlog/warehouse-operation-log/page-with-warehouse`, params })
  },

  // 查询库房操作记录表（记录库房相关操作，支撑审计追溯）详情
  getWarehouseOperationLog: async (id: number) => {
    return await request.get({ url: `/warehouseoperationlog/warehouse-operation-log/get?id=` + id })
  },

  // 新增库房操作记录表（记录库房相关操作，支撑审计追溯）
  createWarehouseOperationLog: async (data: WarehouseOperationLog) => {
    return await request.post({ url: `/warehouseoperationlog/warehouse-operation-log/create`, data })
  },

  // 修改库房操作记录表（记录库房相关操作，支撑审计追溯）
  updateWarehouseOperationLog: async (data: WarehouseOperationLog) => {
    return await request.put({ url: `/warehouseoperationlog/warehouse-operation-log/update`, data })
  },

  // 删除库房操作记录表（记录库房相关操作，支撑审计追溯）
  deleteWarehouseOperationLog: async (id: number) => {
    return await request.delete({ url: `/warehouseoperationlog/warehouse-operation-log/delete?id=` + id })
  },

  /** 批量删除库房操作记录表（记录库房相关操作，支撑审计追溯） */
  deleteWarehouseOperationLogList: async (ids: number[]) => {
    return await request.delete({ url: `/warehouseoperationlog/warehouse-operation-log/delete-list?ids=${ids.join(',')}` })
  },

  // 导出库房操作记录表（记录库房相关操作，支撑审计追溯） Excel
  exportWarehouseOperationLog: async (params) => {
    return await request.download({ url: `/warehouseoperationlog/warehouse-operation-log/export-excel`, params })
  },
}
